# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  def svs_checkboxes(model, field, values)
    content = ""

    if @person[:all_crimes_involved] == nil
      @person[:all_crimes_involved] = ""
    end

    for value in values do
      content <<  check_box(model, field, {:name => model.to_s << "[" << field.to_s << "][]", :checked => checked?(value, @person[:all_crimes_involved])}, value) << " " << value << "<br />\n"
    end
    
    return content
  end
  
  def checked?(name, value)
    if value.index(name) != nil
      return true
  	else
      return false
  	end
  end
end
